package com.daxia.ogmall.web.controller.m;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONArray;
import com.daxia.ogmall.common.HouseAreaTag;
import com.daxia.ogmall.common.MyJSONObject;
import com.daxia.ogmall.dto.AdDTO;
import com.daxia.ogmall.support.MPage;

@Controller
@RequestMapping(value = "/m/houseAreaTag", produces = "application/json;charset=UTF-8")
public class MHouseAreaTagController extends MBaseController {
    
    @ResponseBody
    @RequestMapping("list")
    public String list(AdDTO dto, MPage page) throws Exception {
    
        HouseAreaTag[] houseAreaTags = HouseAreaTag.values();
        MyJSONObject json = new MyJSONObject();
        JSONArray array = new JSONArray();
        for (HouseAreaTag hat : houseAreaTags) {
        	MyJSONObject obj = new MyJSONObject();
        	obj.put("id", hat.getValue());
        	obj.put("name", hat.getRemark());
        	array.add(obj);
        }
        json.put("houseAreaTagInfos", array);
        return toJson(json);
    }
    
}
